package com.china08.yxyapi.api.comm.sws;

import java.text.ParseException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.service.sws.teaching.impl.LecturePackStatisticsServiceImpl;

@CrossOrigin
@RestController
public class TeachingPerPackStatisticsDataTestController {

    @Autowired
    private LecturePackStatisticsServiceImpl lecturePackStatisticsServiceImpl;

    @RequestMapping(value = "/api_yw/comm/sws/teaching/perpack/test", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public void process(HttpServletRequest request, HttpServletResponse response,
            @RequestParam(value = "date") String date) throws ParseException {

        Integer day = Integer.parseInt(date);
        lecturePackStatisticsServiceImpl.getPerPackForUser(day);
    }
}
